﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace pufflesweb
{
    public partial class Alogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            PF.SessionHelper.SetSession("admin", null);//清空之前的用户信息
            string AID = this.aid.Text;
            int Apassword = int.Parse(this.password.Text);

            if (PBLL.Admin.Login(AID, Apassword) == true)
            {
                PModel.Admin admin = PBLL.Admin.Getuser(int.Parse(AID));
                PF.SessionHelper.SetSession("admin", admin);//保存当前用户登录信息
                PF.JsHelper.AlertAndParentUrl("登录成功", "main.aspx");
            }
            else
            {
                PF.JsHelper.AlertAndParentUrl("登录失败", "Alogin.aspx");
            }
        }
    }
}